@function map($val...) { // map
  @if length($val)==1 {
	@return $val;
  } @else if (length($val)==2) {
	@return map_get(nth($val, 1), nth($val, 2));
  } @else if (length($val)==3) {
	@return map_get(map_get(nth($val, 1), nth($val, 2)), nth($val, 3));
  } @else if (length($val)==4) {
	@return map_get(map_get(map_get(nth($val, 1), nth($val, 2)), nth($val, 3)), nth($val, 4));
  } @else {
	@return map_get(map_get(map_get(map_get(nth($val, 1), nth($val, 2)), nth($val, 3)), nth($val, 4)), nth($val, 5));
  }
}

@function for(/*开始值*/$s,/*算法*/$f,/*结束值*/$e,/*是否自乘*/$on-off:false) {
  $s1 : $s;
  $val : 1;
  $min : null;
  $max : null;
  // 1
  @if ($s > $e) { // 初始化最值
	$min : $e;
	$max : $s;
  } @else {
	$min : $s;
	$max : $e;
  }
  @if ($f == \*) { //=================================乘阶
	@if ($on-off) {
	  @for $i from 1 through $e {
		$val : $s * $val;
	  }
	} @else { // S * 至  E
	  @for $i from $min through $max {
		$val : $min * $val;
		$min : $min + 1;
	  }
	}
  }
  @else if ($f == \/) { //=================================除阶
	@if ($on-off) { // 除阶
	  $val: $s;
	  @for $i from 1 through $e {
		$val : $val / $s;
	  }
	} @else { // S / 至  E
	  @for $i from ($min +1) through $max {
		// 起始值大小 特殊处理
		@if($s < $e){
		  $min : $min + 1;
		  $val : $min * $val;
		} @else {
		  $val : $min * $val;
		  $min : $min + 1;
		}
	  }
	  $val : $s / $val;
	  @if($s == $e){ // 特殊处理
	  	$val : 1
	  }
	}
  }
  @else if ($f == \+) { //=================================求和
	$val : 0;
	@if ($on-off) {
	  $val : $s * $e;
	} @else { // 1 + 至 N
	  @for $i from $min through $max {
		$val : $val + $min;
		$min : $min + 1;
	  }
	}
  }
  @else if ($f == \-) { //=================================求差
	$val : 0;
	@if ($on-off) {
	  $val: -($s * $e -$s);
	} @else { // S - 至  E
	  @for $i from ($min +1) through $max {
		// 起始值大小 特殊处理
		@if($s > $e){
		  $val : $min + $val;
		  $min : $min + 1;
		} @else {
		  $min : $min + 1;
		  $val : $min + $val;
		}
	  }
	  $val : $s - $val;
	  @if($s == $e){ // 特殊处理
		$val : 0;
	  }
	}
  }
  @return $val;
}

@function sin($deg){
  $deg : $deg % 360;
  @if(90 > $deg){
	$deg : $deg / 180;
  }@else if(270 > $deg){
	$deg : (180 - $deg) / 180;
  }@else{
	$deg : ($deg - 360) / 180;
  }
  $deg : $deg * 3.141;
  $val : $deg - for($deg,\*,3,true)/for(1,\*,3)
              + for($deg,\*,5,true)/for(1,\*,5)
	          - for($deg,\*,7,true)/for(1,\*,7)
			  + for($deg,\*,9,true)/for(1,\*,9);
	@return $val;
}

@function cos($deg){
  $deg : $deg % 360;
  @if(180 > $deg){
	$deg : $deg / 180;
  }@else if(270 > $deg){
	$deg : ($deg - 360) / 180;
  }@else{
	$deg : (360 -$deg) / 180;
  }
  $deg : $deg * 3.141;
  $val : 1 - for($deg,\*,2,true)/for(1,\*,2)
           + for($deg,\*,4,true)/for(1,\*,4)
	       - for($deg,\*,6,true)/for(1,\*,6)
		   + for($deg,\*,8,true)/for(1,\*,8);
  @return $val;
}

@function tan($deg){
  $val : sin($deg) / cos($deg);
  @return $val;
}